﻿' LibWowArmory
' by Ronald M. Clifford (roncli@roncli.com)
'
' This source code is released under the GNU Library General Public License (LGPL) Version 2.1.

Imports Microsoft.VisualBasic
Imports roncliProductions.LibWowArmory.Internationalization
Imports roncliProductions.LibWowArmory.Character
Imports roncliProductions.LibWowArmory.Data
Imports roncliProductions.LibWowArmory.Guild
Imports roncliProductions.LibWowArmory.Item
Imports roncliProductions.LibWowArmory.PvP
Imports roncliProductions.LibWowArmory.Realms
Imports System
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.Linq

<Assembly: CLSCompliant(True)> 

Namespace roncliProductions.LibWowArmoryDemo

    Public Module modMain

        Private Property Region As Region = Region.NorthAmerica
        Private Property Language As Language = Language.EnglishUS

        Public Sub Main()
            ' There are a number of things to test here, so we will give the user the option of which test to perform.
            Do
                Console.WriteLine("Please choose a test to perform")
                Console.WriteLine("  Or press enter to quit.")
                Console.WriteLine("1 - Change Region")
                Console.WriteLine("2 - Change Language")
                Console.WriteLine("3 - Arena Team")
                Console.WriteLine("4 - Character Classes")
                Console.WriteLine("5 - Character Profile")
                Console.WriteLine("6 - Character Races")
                Console.WriteLine("7 - Guild Perks")
                Console.WriteLine("8 - Guild Profile")
                Console.WriteLine("9 - Guild Rewards")
                Console.WriteLine("10 - Item Classes")
                Console.WriteLine("11 - Item Lookup")
                Console.WriteLine("12 - Realm Status")
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                If String.IsNullOrWhiteSpace(strResponse) Then Exit Do
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 1
                            ChangeRegion()
                        Case 2
                            ChangeLanguage()
                        Case 3
                            ArenaTeamDemo()
                        Case 4
                            CharacterClassesDemo()
                        Case 5
                            CharacterProfileDemo()
                        Case 6
                            CharacterRacesDemo()
                        Case 7
                            GuildPerksDemo()
                        Case 8
                            GuildProfileDemo()
                        Case 9
                            GuildRewardsDemo()
                        Case 10
                            ItemClassesDemo()
                        Case 11
                            ItemLookupDemo()
                        Case 12
                            RealmStatusDemo()
                    End Select
                    Console.Clear()
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop
        End Sub

        Public Sub ChangeRegion()
            Console.Clear()
            Console.WriteLine("Change Region")
            Console.WriteLine()

            Do
                Console.WriteLine("Select the region to use the Armory with")
                Console.WriteLine("1 - North America")
                Console.WriteLine("2 - Europe")
                Console.WriteLine("3 - Korea")
                Console.WriteLine("4 - China")
                Console.WriteLine("5 - Taiwan")
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 1
                            Region = Region.NorthAmerica
                            Exit Do
                        Case 2
                            Region = Region.Europe
                            Exit Do
                        Case 3
                            Region = Region.Korea
                            Exit Do
                        Case 4
                            Region = Region.China
                            Exit Do
                        Case 5
                            Region = Region.Taiwan
                            Exit Do
                        Case Else
                            Console.WriteLine("Invalid response.")
                            Console.WriteLine()
                    End Select
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

        End Sub

        Public Sub ChangeLanguage()
            Console.Clear()
            Console.WriteLine("Change Language")
            Console.WriteLine()

            Do
                Console.WriteLine("Select the language to use the Armory with")
                Console.WriteLine("1 - German")
                Console.WriteLine("2 - English (UK)")
                Console.WriteLine("3 - English (US)")
                Console.WriteLine("4 - Spanish (Mexico)")
                Console.WriteLine("5 - Spanish (Spain)")
                Console.WriteLine("6 - French")
                Console.WriteLine("7 - Russian")
                Console.WriteLine("8 - Korean")
                Console.WriteLine("9 - Chinese (Simplified)")
                Console.WriteLine("10 - Chinese (Traditional)")
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 1
                            Language = Language.Deutsch
                            Exit Do
                        Case 2
                            Language = Language.EnglishEU
                            Exit Do
                        Case 3
                            Language = Language.EnglishUS
                            Exit Do
                        Case 4
                            Language = Language.EspañolAL
                            Exit Do
                        Case 5
                            Language = Language.EspañolEU
                            Exit Do
                        Case 6
                            Language = Language.Français
                            Exit Do
                        Case 7
                            Language = Language.Русский
                            Exit Do
                        Case 8
                            Language = Language.한국어
                            Exit Do
                        Case 9
                            Language = Language.简体中文
                            Exit Do
                        Case 10
                            Language = Language.繁體中文
                            Exit Do
                        Case Else
                            Console.WriteLine("Invalid response.")
                            Console.WriteLine()
                    End Select
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

        End Sub

        Public Sub ArenaTeamDemo()
            Console.WriteLine("Character Profile Demo")
            Console.WriteLine()

            ' Declare some variabales.
            Dim strRealm As String
            Dim intTeamSize As Integer
            Dim strName As String

            ' Next, get the realm.
            Do
                Console.WriteLine("Please enter the name of the realm of the arena team you wish to retrieve.")
                Console.Write(">")
                strRealm = Console.ReadLine

                If String.IsNullOrWhiteSpace(strRealm) Then
                    Console.WriteLine("You must enter a realm name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' Next, get the team size.
            Do
                Console.WriteLine("Please enter an arena team size.")
                Console.WriteLine("2 - 2v2")
                Console.WriteLine("3 - 3v3")
                Console.WriteLine("5 - 5v5")
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                If String.IsNullOrWhiteSpace(strResponse) Then Exit Do
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 2, 3, 5
                            intTeamSize = intResponse
                            Exit Do
                        Case Else
                            Console.WriteLine("Invalid response.")
                            Console.WriteLine()
                    End Select
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

            ' Next, get the character name.
            Do
                Console.WriteLine("Please enter the name of the arena team you wish to retrieve.")
                Console.Write(">")
                strName = Console.ReadLine

                If String.IsNullOrWhiteSpace(strName) Then
                    Console.WriteLine("You must enter an arena team name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' Perform the arena team lookup.
            Dim atTeam As New ArenaTeam(Region, Language, strRealm, intTeamSize, strName)

            ' Show the arena team.
            Console.Clear()
            If atTeam.CacheHit.HasValue AndAlso atTeam.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            Console.WriteLine("{0} - {1} - {2} - {3}v{3} - Created: {4:M/d/yyyy}", atTeam.Team.Realm, atTeam.Team.Side, atTeam.Team.Name, atTeam.Team.TeamSize, atTeam.Team.Created)
            Console.WriteLine("Rating: {0} - Ranking: {1}", atTeam.Team.Rating, atTeam.Team.Ranking)
            Console.WriteLine("Record: {0}-{1} ({2} played) - Session record: {3}-{4} ({5} played)", atTeam.Team.GamesWon, atTeam.Team.GamesLost, atTeam.Team.GamesPlayed, atTeam.Team.SessionGamesWon, atTeam.Team.SessionGamesLost, atTeam.Team.SessionGamesPlayed)
            Console.WriteLine("Current week ranking: {0} - Last session ranking: {1}", atTeam.Team.CurrentWeekRanking, atTeam.Team.LastSessionRanking)
            Console.WriteLine()

            Console.WriteLine("Members:")
            For Each mMember In atTeam.Team.Members
                Console.WriteLine("  {0} - Level {1} {2} {3} {4}", mMember.Character.Name, mMember.Character.Level, mMember.Character.Gender, mMember.Character.Race.Name, mMember.Character.Class.Name)
                If mMember.Rank = 1 Then
                    Console.WriteLine("    Team Owner")
                End If
                Console.WriteLine("    Record: {0}-{1} ({2} played) - Session record: {3}-{4} ({5} played)", mMember.GamesWon, mMember.GamesLost, mMember.GamesPlayed, mMember.SessionGamesWon, mMember.SessionGamesLost, mMember.SessionGamesPlayed)
                Console.WriteLine("    Personal rating: {0}", mMember.PersonalRating)
                Console.WriteLine("    Achievement Points: {0}", mMember.Character.AchievementPoints)
            Next
            Console.WriteLine()

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub CharacterClassesDemo()
            Console.Clear()
            Console.WriteLine("Character Classes Demo")
            Console.WriteLine()

            ' Get the character classes.
            Dim ccClasses As New CharacterClasses(Region, Language)

            ' Show the character classes.
            Console.Clear()
            If ccClasses.CacheHit.HasValue AndAlso ccClasses.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each cClass In ccClasses.Classes
                Console.WriteLine("{0}) {1} - uses {2} - Mask: {3}", cClass.ID, cClass.Name, cClass.PowerType, cClass.Mask)
            Next

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub CharacterProfileDemo()
            Console.Clear()
            Console.WriteLine("Character Profile Demo")
            Console.WriteLine()

            ' Declare some variabales.
            Dim strRealm As String
            Dim strName As String

            ' Next, get the realm.
            Do
                Console.WriteLine("Please enter the name of the realm of the character whose profile you wish to retrieve.")
                Console.Write(">")
                strRealm = Console.ReadLine

                If String.IsNullOrWhiteSpace(strRealm) Then
                    Console.WriteLine("You must enter a realm name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' Next, get the character name.
            Do
                Console.WriteLine("Please enter the name of the character whose profile you wish to retrieve.")
                Console.Write(">")
                strName = Console.ReadLine

                If String.IsNullOrWhiteSpace(strName) Then
                    Console.WriteLine("You must enter a character name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' We can start building the character profile object.
            Dim cpCharacter As New CharacterProfile(Region, Language)
            cpCharacter.Options.Realm = strRealm
            cpCharacter.Options.Name = strName

            ' Next, allow the user to set the options.
            Console.Clear()
            Do
                Console.WriteLine("Character Profile Options")
                Console.WriteLine()
                Console.WriteLine("Please set the options you wish for looking up the character profile.")
                Console.WriteLine("  Or press enter to perform the character lookup.")
                Console.WriteLine("1 - Include Guild - {0}", If(cpCharacter.Options.Guild, "Yes", "No"))
                Console.WriteLine("2 - Include Combat Stats - {0}", If(cpCharacter.Options.Stats, "Yes", "No"))
                Console.WriteLine("3 - Include Talents - {0}", If(cpCharacter.Options.Talents, "Yes", "No"))
                Console.WriteLine("4 - Include Items - {0}", If(cpCharacter.Options.Items, "Yes", "No"))
                Console.WriteLine("5 - Include Reputation - {0}", If(cpCharacter.Options.Reputation, "Yes", "No"))
                Console.WriteLine("6 - Include Titles - {0}", If(cpCharacter.Options.Titles, "Yes", "No"))
                Console.WriteLine("7 - Include Professions - {0}", If(cpCharacter.Options.Professions, "Yes", "No"))
                Console.WriteLine("8 - Include Appearance - {0}", If(cpCharacter.Options.Appearance, "Yes", "No"))
                Console.WriteLine("9 - Include Companion Pets - {0}", If(cpCharacter.Options.Companions, "Yes", "No"))
                Console.WriteLine("10 - Include Mounts - {0}", If(cpCharacter.Options.Mounts, "Yes", "No"))
                Console.WriteLine("11 - Include Combat Pets - {0}", If(cpCharacter.Options.Pets, "Yes", "No"))
                Console.WriteLine("12 - Include Achievements - {0}", If(cpCharacter.Options.Achievements, "Yes", "No"))
                Console.WriteLine("13 - Include Progression - {0}", If(cpCharacter.Options.Progression, "Yes", "No"))
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                If String.IsNullOrWhiteSpace(strResponse) Then Exit Do
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 1
                            cpCharacter.Options.Guild = Not cpCharacter.Options.Guild
                        Case 2
                            cpCharacter.Options.Stats = Not cpCharacter.Options.Stats
                        Case 3
                            cpCharacter.Options.Talents = Not cpCharacter.Options.Talents
                        Case 4
                            cpCharacter.Options.Items = Not cpCharacter.Options.Items
                        Case 5
                            cpCharacter.Options.Reputation = Not cpCharacter.Options.Reputation
                        Case 6
                            cpCharacter.Options.Titles = Not cpCharacter.Options.Titles
                        Case 7
                            cpCharacter.Options.Professions = Not cpCharacter.Options.Professions
                        Case 8
                            cpCharacter.Options.Appearance = Not cpCharacter.Options.Appearance
                        Case 9
                            cpCharacter.Options.Companions = Not cpCharacter.Options.Companions
                        Case 10
                            cpCharacter.Options.Mounts = Not cpCharacter.Options.Mounts
                        Case 11
                            cpCharacter.Options.Pets = Not cpCharacter.Options.Pets
                        Case 12
                            cpCharacter.Options.Achievements = Not cpCharacter.Options.Achievements
                        Case 13
                            cpCharacter.Options.Progression = Not cpCharacter.Options.Progression
                    End Select
                    Console.Clear()
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

            ' Perform the character profile lookup.
            cpCharacter.Load()

            ' Show the character profile.
            Console.Clear()
            If cpCharacter.CacheHit.HasValue AndAlso cpCharacter.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            Console.WriteLine("{0} - {1} - Level {2} {3} {4} {5}", cpCharacter.Character.Realm, cpCharacter.Character.Name, cpCharacter.Character.Level, cpCharacter.Character.Gender, cpCharacter.Character.Race.Name, cpCharacter.Character.Class.Name)
            Console.WriteLine("Last updated: {0:M/d/yyyy h:mm:ss tt}", cpCharacter.Character.LastModified.ToLocalTime())
            Console.WriteLine("Achievement points: {0}", cpCharacter.Character.AchievementPoints)
            Console.WriteLine("Thumbnail: {0}", cpCharacter.Character.Thumbnail)
            Console.WriteLine()

            If cpCharacter.Character.Guild IsNot Nothing Then
                Console.WriteLine("Guild:")
                Console.WriteLine("  {0} - Level {1} - {2} members - {3} achievement points", cpCharacter.Character.Guild.Name, cpCharacter.Character.Guild.Level, cpCharacter.Character.Guild.Members, cpCharacter.Character.Guild.AchievementPoints)
                Console.WriteLine("  Guild Emblem:")
                Console.WriteLine("    Icon: {0}", cpCharacter.Character.Guild.Emblem.Icon)
                Console.WriteLine("    Icon Color: {0}", cpCharacter.Character.Guild.Emblem.IconColor.Name)
                Console.WriteLine("    Border: {0}", cpCharacter.Character.Guild.Emblem.Border)
                Console.WriteLine("    Border Color: {0}", cpCharacter.Character.Guild.Emblem.BorderColor.Name)
                Console.WriteLine("    Background Color: {0}", cpCharacter.Character.Guild.Emblem.BackgroundColor.Name)
                Console.WriteLine()
            End If

            If cpCharacter.Character.Stats IsNot Nothing Then
                Console.WriteLine("Stats:")
                Console.WriteLine("  Health: {0} - {1}: {2}", cpCharacter.Character.Stats.Health, cpCharacter.Character.Stats.PowerType, cpCharacter.Character.Stats.Power)
                Console.WriteLine("  Str {0} - Agi {1} - Sta {2} - Int {3} - Spr {4}", cpCharacter.Character.Stats.Str, cpCharacter.Character.Stats.Agi, cpCharacter.Character.Stats.Sta, cpCharacter.Character.Stats.Int, cpCharacter.Character.Stats.Spr)
                Console.WriteLine("  Attack Power: {0} (Ranged: {1})", cpCharacter.Character.Stats.AttackPower, cpCharacter.Character.Stats.RangedAttackPower)
                Console.WriteLine("  Mastery: {0:N2} (Rating: {1})", cpCharacter.Character.Stats.Mastery, cpCharacter.Character.Stats.MasteryRating)
                Console.WriteLine("  Crit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.Crit, cpCharacter.Character.Stats.CritRating)
                Console.WriteLine("  Hit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.HitPercent, cpCharacter.Character.Stats.HitRating)
                Console.WriteLine("  Haste Rating: {0}", cpCharacter.Character.Stats.HasteRating)
                Console.WriteLine("  Expertise Rating: {0}", cpCharacter.Character.Stats.ExpertiseRating)
                Console.WriteLine("  Spell Power: {0}", cpCharacter.Character.Stats.SpellPower)
                Console.WriteLine("  Spell Penetration: {0}", cpCharacter.Character.Stats.SpellPen)
                Console.WriteLine("  Spell Crit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.SpellCrit, cpCharacter.Character.Stats.SpellCritRating)
                Console.WriteLine("  Spell Hit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.SpellHitPercent, cpCharacter.Character.Stats.SpellHitRating)
                Console.WriteLine("  Mana Per 5: {0} (While In Combat: {1})", cpCharacter.Character.Stats.Mana5, cpCharacter.Character.Stats.Mana5Combat)
                Console.WriteLine("  Armor: {0}", cpCharacter.Character.Stats.Armor)
                Console.WriteLine("  Dodge: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.Dodge, cpCharacter.Character.Stats.DodgeRating)
                Console.WriteLine("  Parry: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.Parry, cpCharacter.Character.Stats.ParryRating)
                Console.WriteLine("  Block: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.Block, cpCharacter.Character.Stats.BlockRating)
                Console.WriteLine("  Resilience: {0}", cpCharacter.Character.Stats.Resil)
                Console.WriteLine("  Main Hand: {0:N1}-{1:N1} Damage, {2:N2} Speed, {3:N2} DPS, {4} Expertise", cpCharacter.Character.Stats.MainHandDmgMin, cpCharacter.Character.Stats.MainHandDmgMax, cpCharacter.Character.Stats.MainHandSpeed, cpCharacter.Character.Stats.MainHandDps, cpCharacter.Character.Stats.MainHandExpertise)
                Console.WriteLine("  Off Hand: {0:N1}-{1:N1} Damage, {2:N2} Speed, {3:N2} DPS, {4} Expertise", cpCharacter.Character.Stats.OffHandDmgMin, cpCharacter.Character.Stats.OffHandDmgMax, cpCharacter.Character.Stats.OffHandSpeed, cpCharacter.Character.Stats.OffHandDps, cpCharacter.Character.Stats.OffHandExpertise)
                Console.WriteLine("  Ranged: {0:N1}-{1:N1} Damage, {2:N2} Speed, {3:N2} DPS", cpCharacter.Character.Stats.RangedDmgMin, cpCharacter.Character.Stats.RangedDmgMax, cpCharacter.Character.Stats.RangedSpeed, cpCharacter.Character.Stats.RangedDps)
                Console.WriteLine("  Ranged Crit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.RangedCrit, cpCharacter.Character.Stats.RangedCritRating)
                Console.WriteLine("  Ranged Hit: {0:N2}% (Rating: {1})", cpCharacter.Character.Stats.RangedHitPercent, cpCharacter.Character.Stats.RangedHitRating)
                Console.WriteLine()
            End If

            If cpCharacter.Character.Talents IsNot Nothing Then
                Console.WriteLine("Talents:")
                For Each tTalent In cpCharacter.Character.Talents
                    Console.WriteLine("  {0} {1}/{2}/{3}{4}", tTalent.Name, tTalent.Trees(0).Total, tTalent.Trees(1).Total, tTalent.Trees(2).Total, If(tTalent.Selected, " - Selected", ""))
                    Console.WriteLine("    Build: {0} {1} {2}", tTalent.Trees(0).Points, tTalent.Trees(1).Points, tTalent.Trees(2).Points)
                    Console.WriteLine("    Glyphs:")
                    Console.WriteLine("      Prime:")
                    For Each gGlyph In tTalent.Glyphs.Prime
                        Console.WriteLine("        {0} - ID {1} - Item {2}", gGlyph.Name, gGlyph.Glyph, gGlyph.Item)
                    Next
                    Console.WriteLine("      Major:")
                    For Each gGlyph In tTalent.Glyphs.Major
                        Console.WriteLine("        {0} - ID {1} - Item {2}", gGlyph.Name, gGlyph.Glyph, gGlyph.Item)
                    Next
                    Console.WriteLine("      Minor:")
                    For Each gGlyph In tTalent.Glyphs.Minor
                        Console.WriteLine("        {0} - ID {1} - Item {2}", gGlyph.Name, gGlyph.Glyph, gGlyph.Item)
                    Next
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Items IsNot Nothing Then
                Console.WriteLine("Items:")
                Console.WriteLine("  Average Item Level: {0} (Equipped: {1})", cpCharacter.Character.Items.AverageItemLevel, cpCharacter.Character.Items.AverageItemLevelEquipped)
                If cpCharacter.Character.Items.Head IsNot Nothing Then
                    Console.WriteLine("  Head: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Head.Name, cpCharacter.Character.Items.Head.ID, cpCharacter.Character.Items.Head.Quality)
                    If cpCharacter.Character.Items.Head.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Head.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Head.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Head.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Head.TooltipParams.Suffix, cpCharacter.Character.Items.Head.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Head.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Head.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Head.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Head.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Head.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Head.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Neck IsNot Nothing Then
                    Console.WriteLine("  Neck: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Neck.Name, cpCharacter.Character.Items.Neck.ID, cpCharacter.Character.Items.Neck.Quality)
                    If cpCharacter.Character.Items.Neck.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Neck.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Neck.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Neck.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Neck.TooltipParams.Suffix, cpCharacter.Character.Items.Neck.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Neck.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Neck.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Neck.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Neck.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Neck.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Neck.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Shoulder IsNot Nothing Then
                    Console.WriteLine("  Shoulder: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Shoulder.Name, cpCharacter.Character.Items.Shoulder.ID, cpCharacter.Character.Items.Shoulder.Quality)
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Shoulder.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Shoulder.TooltipParams.Suffix, cpCharacter.Character.Items.Shoulder.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Shoulder.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Shoulder.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Shoulder.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Shoulder.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Back IsNot Nothing Then
                    Console.WriteLine("  Back: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Back.Name, cpCharacter.Character.Items.Back.ID, cpCharacter.Character.Items.Back.Quality)
                    If cpCharacter.Character.Items.Back.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Back.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Back.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Back.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Back.TooltipParams.Suffix, cpCharacter.Character.Items.Back.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Back.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Back.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Back.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Back.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Back.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Back.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Chest IsNot Nothing Then
                    Console.WriteLine("  Chest: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Chest.Name, cpCharacter.Character.Items.Chest.ID, cpCharacter.Character.Items.Chest.Quality)
                    If cpCharacter.Character.Items.Chest.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Chest.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Chest.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Chest.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Chest.TooltipParams.Suffix, cpCharacter.Character.Items.Chest.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Chest.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Chest.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Chest.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Chest.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Chest.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Chest.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Shirt IsNot Nothing Then
                    Console.WriteLine("  Shirt: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Shirt.Name, cpCharacter.Character.Items.Shirt.ID, cpCharacter.Character.Items.Shirt.Quality)
                    If cpCharacter.Character.Items.Shirt.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Shirt.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Shirt.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Shirt.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Shirt.TooltipParams.Suffix, cpCharacter.Character.Items.Shirt.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Shirt.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Shirt.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Shirt.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Shirt.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Shirt.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Shirt.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Tabard IsNot Nothing Then
                    Console.WriteLine("  Tabard: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Tabard.Name, cpCharacter.Character.Items.Tabard.ID, cpCharacter.Character.Items.Tabard.Quality)
                    If cpCharacter.Character.Items.Tabard.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Tabard.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Tabard.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Tabard.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Tabard.TooltipParams.Suffix, cpCharacter.Character.Items.Tabard.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Tabard.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Tabard.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Tabard.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Tabard.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Tabard.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Tabard.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Wrist IsNot Nothing Then
                    Console.WriteLine("  Wrist: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Wrist.Name, cpCharacter.Character.Items.Wrist.ID, cpCharacter.Character.Items.Wrist.Quality)
                    If cpCharacter.Character.Items.Wrist.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Wrist.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Wrist.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Wrist.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Wrist.TooltipParams.Suffix, cpCharacter.Character.Items.Wrist.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Wrist.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Wrist.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Wrist.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Wrist.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Wrist.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Wrist.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Hands IsNot Nothing Then
                    Console.WriteLine("  Hands: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Hands.Name, cpCharacter.Character.Items.Hands.ID, cpCharacter.Character.Items.Hands.Quality)
                    If cpCharacter.Character.Items.Hands.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Hands.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Hands.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Hands.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Hands.TooltipParams.Suffix, cpCharacter.Character.Items.Hands.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Hands.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Hands.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Hands.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Hands.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Hands.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Hands.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Waist IsNot Nothing Then
                    Console.WriteLine("  Waist: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Waist.Name, cpCharacter.Character.Items.Waist.ID, cpCharacter.Character.Items.Waist.Quality)
                    If cpCharacter.Character.Items.Waist.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Waist.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Waist.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Waist.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Waist.TooltipParams.Suffix, cpCharacter.Character.Items.Waist.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Waist.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Waist.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Waist.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Waist.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Waist.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Waist.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Legs IsNot Nothing Then
                    Console.WriteLine("  Legs: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Legs.Name, cpCharacter.Character.Items.Legs.ID, cpCharacter.Character.Items.Legs.Quality)
                    If cpCharacter.Character.Items.Legs.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Legs.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Legs.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Legs.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Legs.TooltipParams.Suffix, cpCharacter.Character.Items.Legs.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Legs.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Legs.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Legs.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Legs.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Legs.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Legs.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Feet IsNot Nothing Then
                    Console.WriteLine("  Feet: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Feet.Name, cpCharacter.Character.Items.Feet.ID, cpCharacter.Character.Items.Feet.Quality)
                    If cpCharacter.Character.Items.Feet.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Feet.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Feet.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Feet.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Feet.TooltipParams.Suffix, cpCharacter.Character.Items.Feet.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Feet.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Feet.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Feet.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Feet.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Feet.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Feet.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Finger1 IsNot Nothing Then
                    Console.WriteLine("  Finger1: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Finger1.Name, cpCharacter.Character.Items.Finger1.ID, cpCharacter.Character.Items.Finger1.Quality)
                    If cpCharacter.Character.Items.Finger1.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Finger1.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Finger1.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Finger1.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Finger1.TooltipParams.Suffix, cpCharacter.Character.Items.Finger1.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Finger1.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Finger1.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Finger1.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Finger1.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Finger1.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Finger1.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Finger2 IsNot Nothing Then
                    Console.WriteLine("  Finger2: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Finger2.Name, cpCharacter.Character.Items.Finger2.ID, cpCharacter.Character.Items.Finger2.Quality)
                    If cpCharacter.Character.Items.Finger2.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Finger2.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Finger2.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Finger2.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Finger2.TooltipParams.Suffix, cpCharacter.Character.Items.Finger2.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Finger2.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Finger2.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Finger2.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Finger2.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Finger2.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Finger2.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Trinket1 IsNot Nothing Then
                    Console.WriteLine("  Trinket1: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Trinket1.Name, cpCharacter.Character.Items.Trinket1.ID, cpCharacter.Character.Items.Trinket1.Quality)
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Trinket1.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Trinket1.TooltipParams.Suffix, cpCharacter.Character.Items.Trinket1.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Trinket1.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Trinket1.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Trinket1.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Trinket1.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Trinket2 IsNot Nothing Then
                    Console.WriteLine("  Trinket2: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Trinket2.Name, cpCharacter.Character.Items.Trinket2.ID, cpCharacter.Character.Items.Trinket2.Quality)
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Trinket2.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Trinket2.TooltipParams.Suffix, cpCharacter.Character.Items.Trinket2.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Trinket2.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Trinket2.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Trinket2.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Trinket2.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.MainHand IsNot Nothing Then
                    Console.WriteLine("  MainHand: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.MainHand.Name, cpCharacter.Character.Items.MainHand.ID, cpCharacter.Character.Items.MainHand.Quality)
                    If cpCharacter.Character.Items.MainHand.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.MainHand.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.MainHand.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.MainHand.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.MainHand.TooltipParams.Suffix, cpCharacter.Character.Items.MainHand.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.MainHand.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.MainHand.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.MainHand.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.MainHand.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.MainHand.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.MainHand.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.OffHand IsNot Nothing Then
                    Console.WriteLine("  OffHand: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.OffHand.Name, cpCharacter.Character.Items.OffHand.ID, cpCharacter.Character.Items.OffHand.Quality)
                    If cpCharacter.Character.Items.OffHand.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.OffHand.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.OffHand.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.OffHand.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.OffHand.TooltipParams.Suffix, cpCharacter.Character.Items.OffHand.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.OffHand.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.OffHand.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.OffHand.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.OffHand.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.OffHand.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.OffHand.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                If cpCharacter.Character.Items.Ranged IsNot Nothing Then
                    Console.WriteLine("  Ranged: {0} - ID {1} - Quality: {2}", cpCharacter.Character.Items.Ranged.Name, cpCharacter.Character.Items.Ranged.ID, cpCharacter.Character.Items.Ranged.Quality)
                    If cpCharacter.Character.Items.Ranged.TooltipParams.Gems.Count > 0 Then
                        Console.WriteLine("    Gems: {0}", String.Join(", ", cpCharacter.Character.Items.Ranged.TooltipParams.Gems.Select(Function(g) g.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                    If cpCharacter.Character.Items.Ranged.TooltipParams.ExtraSocket Then
                        Console.WriteLine("      Includes Extra Socket.")
                    End If
                    If cpCharacter.Character.Items.Ranged.TooltipParams.Suffix <> 0 Then
                        Console.WriteLine("    Suffix: {0} (Seed: {1})", cpCharacter.Character.Items.Ranged.TooltipParams.Suffix, cpCharacter.Character.Items.Ranged.TooltipParams.Seed)
                    End If
                    If cpCharacter.Character.Items.Ranged.TooltipParams.Enchant <> 0 Then
                        Console.WriteLine("    Enchant: {0}", cpCharacter.Character.Items.Ranged.TooltipParams.Enchant)
                    End If
                    If cpCharacter.Character.Items.Ranged.TooltipParams.Reforge <> 0 Then
                        Console.WriteLine("    Reforge: {0}", cpCharacter.Character.Items.Ranged.TooltipParams.Reforge)
                    End If
                    If cpCharacter.Character.Items.Ranged.TooltipParams.Set.Count > 0 Then
                        Console.WriteLine("    Set items: {0}", String.Join(", ", cpCharacter.Character.Items.Ranged.TooltipParams.Set.Select(Function(s) s.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                End If
                Console.WriteLine()
            End If

            If cpCharacter.Character.Reputation IsNot Nothing Then
                Console.WriteLine("Reputation:")
                For Each rReputation In cpCharacter.Character.Reputation
                    Console.WriteLine("  {0} - ID: {1} - {2}/{3} {4}", rReputation.Name, rReputation.ID, rReputation.Value, rReputation.Max, rReputation.Standing)
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Titles IsNot Nothing Then
                Console.WriteLine("Titles:")
                For Each tTitle In cpCharacter.Character.Titles
                    Console.WriteLine("  {0} - ID: {1}{2}", tTitle.Name.Replace("%s", cpCharacter.Character.Name), tTitle.ID, If(tTitle.Selected, " - Selected", ""))
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Professions IsNot Nothing Then
                Console.WriteLine("Professions:")
                Console.WriteLine("  Primary:")
                For Each pProfession In cpCharacter.Character.Professions.Primary
                    Console.WriteLine("    {0} - ID: {1} - {2}/{3}", pProfession.Name, pProfession.ID, pProfession.Rank, pProfession.Max)
                    If pProfession.Recipes.Count > 0 Then
                        Console.WriteLine("      Recipes: {0}", String.Join(", ", pProfession.Recipes.Select(Function(r) r.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                Next
                Console.WriteLine("  Secondary:")
                For Each pProfession In cpCharacter.Character.Professions.Secondary
                    Console.WriteLine("    {0} - ID: {1} - {2}/{3}", pProfession.Name, pProfession.ID, pProfession.Rank, pProfession.Max)
                    If pProfession.Recipes.Count > 0 Then
                        Console.WriteLine("      Recipes: {0}", String.Join(", ", pProfession.Recipes.Select(Function(r) r.ToString(CultureInfo.InvariantCulture)).ToArray()))
                    End If
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Appearance IsNot Nothing Then
                Console.WriteLine("Appearance:")
                Console.WriteLine("  Face variation: {0}", cpCharacter.Character.Appearance.FaceVariation)
                Console.WriteLine("  Skin color: {0}", cpCharacter.Character.Appearance.SkinColor)
                Console.WriteLine("  Hair variation: {0}", cpCharacter.Character.Appearance.HairVariation)
                Console.WriteLine("  Hair color: {0}", cpCharacter.Character.Appearance.HairColor)
                Console.WriteLine("  Feature variation: {0}", cpCharacter.Character.Appearance.FeatureVariation)
                Console.WriteLine("  Show helm: {0}", If(cpCharacter.Character.Appearance.ShowHelm, "Yes", "No"))
                Console.WriteLine("  Show cloak: {0}", If(cpCharacter.Character.Appearance.ShowCloak, "Yes", "No"))
                Console.WriteLine()
            End If

            If cpCharacter.Character.Companions IsNot Nothing Then
                Console.WriteLine("Companions:")
                Console.WriteLine("  {0}", String.Join(", ", cpCharacter.Character.Companions.Select(Function(c) c.ToString(CultureInfo.InvariantCulture)).ToArray()))
                Console.WriteLine()
            End If

            If cpCharacter.Character.Mounts IsNot Nothing Then
                Console.WriteLine("Mounts:")
                Console.WriteLine("  {0}", String.Join(", ", cpCharacter.Character.Mounts.Select(Function(c) c.ToString(CultureInfo.InvariantCulture)).ToArray()))
                Console.WriteLine()
            End If

            If cpCharacter.Character.Pets IsNot Nothing Then
                Console.WriteLine("Pets:")
                For Each pPet In cpCharacter.Character.Pets
                    Console.WriteLine("  {0} - Creature: {1} - Slot: {2}", pPet.Name, pPet.Creature, pPet.Slot)
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Achievements IsNot Nothing Then
                Console.WriteLine("Achievements:")
                For Each aAchievement In cpCharacter.Character.Achievements.Achievements
                    Console.WriteLine("  ID: {0} - Completed: {1:M/d/yyyy h:mm:ss tt}", aAchievement.ID, aAchievement.Timestamp.ToLocalTime())
                Next
                Console.WriteLine()
                Console.WriteLine("Guild Achievement Criteria:")
                For Each cCriteria In cpCharacter.Character.Achievements.Criteria
                    Console.WriteLine("  ID: {0} - Started: {1: M/d/yyyy h:mm:ss tt} - Completed: {2: M/d/yyyy h:mm:ss tt} - Quantity: {3}", cCriteria.ID, cCriteria.Timestamp.ToLocalTime(), cCriteria.Created.ToLocalTime(), cCriteria.Quantity)
                Next
                Console.WriteLine()
            End If

            If cpCharacter.Character.Progression IsNot Nothing Then
                Console.WriteLine("Progression:")
                Console.WriteLine("  Raids:")
                For Each rRaid In cpCharacter.Character.Progression.Raids
                    Console.WriteLine("    {0} - ID: {1} - Normal: {2} - Heroic: {3}", rRaid.Name, rRaid.ID, rRaid.Normal, rRaid.Heroic)
                    For Each bBoss In rRaid.Bosses
                        Console.WriteLine("      {0} - ID: {1} - Normal: {2} - Heroic: {3}", bBoss.Name, bBoss.ID, bBoss.NormalKills, bBoss.HeroicKills)
                    Next
                Next
                Console.WriteLine()
            End If

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub CharacterRacesDemo()
            Console.Clear()
            Console.WriteLine("Character Races Demo")
            Console.WriteLine()

            ' Get the character races.
            Dim crRaces As New CharacterRaces(Region, Language)

            ' Show the character races.
            Console.Clear()
            If crRaces.CacheHit.HasValue AndAlso crRaces.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each rRace In crRaces.Races
                Console.WriteLine("{0}) {1} - {2} - Mask: {3}", rRace.ID, rRace.Name, rRace.Side, rRace.Mask)
            Next

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub GuildPerksDemo()
            Console.Clear()
            Console.WriteLine("Guild Perks Demo")
            Console.WriteLine()

            ' Get the guild perks.
            Dim gpPerks As New GuildPerks(Region, Language)

            ' Show the guild perks.
            Console.Clear()
            If gpPerks.CacheHit.HasValue AndAlso gpPerks.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each pPerk In gpPerks.Perks
                If String.IsNullOrWhiteSpace(pPerk.Spell.Rank) Then
                    Console.WriteLine("Level {0} - {1} - ID: {2}", pPerk.GuildLevel, pPerk.Spell.Name, pPerk.Spell.ID)
                Else
                    Console.WriteLine("Level {0} - {1} {2} - ID: {3}", pPerk.GuildLevel, pPerk.Spell.Name, pPerk.Spell.Rank, pPerk.Spell.ID)
                End If
                If Not String.IsNullOrWhiteSpace(pPerk.Spell.Range) Then
                    Console.WriteLine("Range: {0}", pPerk.Spell.Range)
                End If
                Console.WriteLine(pPerk.Spell.Description)
                If Not String.IsNullOrWhiteSpace(pPerk.Spell.CastTime) Then
                    Console.WriteLine("Cast Time: {0}", pPerk.Spell.CastTime)
                End If
                If Not String.IsNullOrWhiteSpace(pPerk.Spell.Cooldown) Then
                    Console.WriteLine("Cooldown: {0}", pPerk.Spell.Cooldown)
                End If
                Console.WriteLine()
            Next

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub GuildProfileDemo()
            Console.Clear()
            Console.WriteLine("Guild Profile Demo")
            Console.WriteLine()

            ' Declare some variabales.
            Dim strRealm As String
            Dim strName As String

            ' Next, get the realm.
            Do
                Console.WriteLine("Please enter the name of the realm of the guild whose profile you wish to retrieve.")
                Console.Write(">")
                strRealm = Console.ReadLine

                If String.IsNullOrWhiteSpace(strRealm) Then
                    Console.WriteLine("You must enter a realm name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' Next, get the guild name.
            Do
                Console.WriteLine("Please enter the name of the guild whose profile you wish to retrieve.")
                Console.Write(">")
                strName = Console.ReadLine

                If String.IsNullOrWhiteSpace(strName) Then
                    Console.WriteLine("You must enter a guild name.")
                    Console.WriteLine()
                Else
                    Exit Do
                End If
            Loop

            ' We can start building the guild profile object.
            Dim gpGuild As New GuildProfile(Region, Language)
            gpGuild.Options.Realm = strRealm
            gpGuild.Options.Name = strName

            ' Next, allow the user to set the options.
            Console.Clear()
            Do
                Console.WriteLine("Guild Profile Options")
                Console.WriteLine()
                Console.WriteLine("Please set the options you wish for looking up the guild profile.")
                Console.WriteLine("  Or press enter to perform the guild lookup.")
                Console.WriteLine("1 - Include Guild Achievements - {0}", If(gpGuild.Options.Achievements, "Yes", "No"))
                Console.WriteLine("2 - Include Members - {0}", If(gpGuild.Options.Members, "Yes", "No"))
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                If String.IsNullOrWhiteSpace(strResponse) Then Exit Do
                Dim intResponse As Integer
                If Integer.TryParse(strResponse, intResponse) Then
                    Select Case intResponse
                        Case 1
                            gpGuild.Options.Achievements = Not gpGuild.Options.Achievements
                        Case 2
                            gpGuild.Options.Members = Not gpGuild.Options.Members
                    End Select
                    Console.Clear()
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

            ' Perform the guild profile lookup.
            gpGuild.Load()

            ' Show the guild profile.
            Console.Clear()
            If gpGuild.CacheHit.HasValue AndAlso gpGuild.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            Console.WriteLine("{0} - {1} - {2} - Level {3}", gpGuild.Guild.Realm, gpGuild.Guild.Side, gpGuild.Guild.Name, gpGuild.Guild.Level)
            Console.WriteLine("Last updated: {0:M/d/yyyy h:mm:ss tt}", gpGuild.Guild.LastModified.ToLocalTime())
            Console.WriteLine("Guild Achievement Points: {0}", gpGuild.Guild.AchievementPoints)
            Console.WriteLine("Guild Emblem:")
            Console.WriteLine("  Icon: {0}", gpGuild.Guild.Emblem.Icon)
            Console.WriteLine("  Icon Color: {0}", gpGuild.Guild.Emblem.IconColor.Name)
            Console.WriteLine("  Border: {0}", gpGuild.Guild.Emblem.Border)
            Console.WriteLine("  Border Color: {0}", gpGuild.Guild.Emblem.BorderColor.Name)
            Console.WriteLine("  Background Color: {0}", gpGuild.Guild.Emblem.BackgroundColor.Name)
            Console.WriteLine()

            If gpGuild.Guild.Achievements IsNot Nothing Then
                Console.WriteLine("Guild Achievements:")
                For Each aAchievement In gpGuild.Guild.Achievements.Achievements
                    Console.WriteLine("  ID: {0} - Completed: {1:M/d/yyyy h:mm:ss tt}", aAchievement.ID, aAchievement.Timestamp.ToLocalTime())
                Next
                Console.WriteLine()
                Console.WriteLine("Guild Achievement Criteria:")
                For Each cCriteria In gpGuild.Guild.Achievements.Criteria
                    Console.WriteLine("  ID: {0} - Started: {1: M/d/yyyy h:mm:ss tt} - Completed: {2: M/d/yyyy h:mm:ss tt} - Quantity: {3}", cCriteria.ID, cCriteria.Timestamp.ToLocalTime(), cCriteria.Created.ToLocalTime(), cCriteria.Quantity)
                Next
                Console.WriteLine()
            End If

            If gpGuild.Guild.Members IsNot Nothing Then
                Console.WriteLine("Members:")
                For Each mMember In gpGuild.Guild.Members
                    Console.WriteLine("  {0} - Level {1} {2} {3} {4} - Rank {5}", mMember.Character.Name, mMember.Character.Level, mMember.Character.Gender, mMember.Character.Race.Name, mMember.Character.Class.Name, mMember.Rank)
                Next
                Console.WriteLine()
            End If

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub GuildRewardsDemo()
            Console.Clear()
            Console.WriteLine("Guild Rewards Demo")
            Console.WriteLine()

            ' Get the guild rewards.
            Dim grRewards As New GuildRewards(Region, Language)

            ' Show the guild rewards.
            Console.Clear()
            If grRewards.CacheHit.HasValue AndAlso grRewards.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each rReward In grRewards.Rewards
                Console.WriteLine("{0} - ID: {1} - Quality: {2}", rReward.Item.Name, rReward.Item.ID, rReward.Item.Quality)
                If rReward.RequiredGuildLevel > 0 Then
                    Console.WriteLine("Required Guild Level: {0}", rReward.RequiredGuildLevel)
                End If
                Console.WriteLine("Required Guild Standing: {0}", rReward.RequiredGuildStanding)
                If rReward.Races IsNot Nothing Then
                    Console.WriteLine("Required races: {0}", String.Join(", ", rReward.Races.Select(Function(r) r.Name)))
                End If
                If rReward.Achievement IsNot Nothing Then
                    Console.WriteLine("Guild Achievement: {0} - ID: {1} - {2} Points", rReward.Achievement.Title, rReward.Achievement.ID, rReward.Achievement.Points)
                    Console.WriteLine("  {0}", rReward.Achievement.Description)
                End If
                Console.WriteLine()
            Next

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub ItemClassesDemo()
            Console.Clear()
            Console.WriteLine("Item Classes Demo")
            Console.WriteLine()

            ' Get the item classes.
            Dim icClasses As New ItemClasses(Region, Language)

            ' Show the item classes.
            Console.Clear()
            If icClasses.CacheHit.HasValue AndAlso icClasses.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each cClass In icClasses.Classes
                Console.WriteLine("{0}) {1}", cClass.Class, cClass.Name)
            Next
            Console.WriteLine()

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub ItemLookupDemo()
            Console.Clear()
            Console.WriteLine("Item Lookup Demo")
            Console.WriteLine()

            ' First, setup some variables
            Dim intItemID As Integer

            ' Next, get the item ID.
            Do
                Console.WriteLine("Please enter the ID number of the item you wish to lookup.")
                Console.Write(">")
                Dim strResponse = Console.ReadLine
                If String.IsNullOrWhiteSpace(strResponse) Then Exit Do
                If Integer.TryParse(strResponse, intItemID) Then
                    Exit Do
                Else
                    Console.WriteLine("Invalid response.")
                    Console.WriteLine()
                End If
            Loop

            ' Get the Item.
            Dim iItem As New ItemLookup(Region, Language, intItemID)

            ' Show the item.
            Console.Clear()
            If iItem.CacheHit.HasValue AndAlso iItem.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            Console.WriteLine("{0} - ID: {1} - Quality: {2}", iItem.Item.Name, iItem.Item.ID, iItem.Item.Quality)
            Console.WriteLine("Item class: {0}", iItem.Item.ItemClass.Name)
            Console.WriteLine()

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

        Public Sub RealmStatusDemo()
            Console.Clear()
            Console.WriteLine("Realm Status Demo")
            Console.WriteLine()

            ' Declare some variables.
            Dim strRealm As String
            Dim lstRealm As New List(Of String)

            ' Next, get the realm.
            Do
                Console.WriteLine("Please enter the name of the realm whose status you wish to retrieve.")
                Console.WriteLine("  Or press enter to continue.")
                Console.Write(">")
                strRealm = Console.ReadLine

                If String.IsNullOrWhiteSpace(strRealm) Then
                    Exit Do
                Else
                    lstRealm.Add(strRealm)
                    Console.WriteLine()
                End If
            Loop

            If lstRealm.Count = 0 Then Exit Sub

            ' Get the realm status.
            Dim rsStatus As New RealmStatus(Region, Language, lstRealm)

            ' Show the realm status.
            Console.Clear()
            If rsStatus.CacheHit.HasValue AndAlso rsStatus.CacheHit.Value Then
                Console.WriteLine("Cache hit!")
                Console.WriteLine()
            End If

            For Each rRealm In rsStatus.Realms
                Console.WriteLine("{0} - {1}", rRealm.Name, rRealm.Type)
                Console.WriteLine("Population: {0}", rRealm.Population)
                Console.WriteLine("Stauts: {0} - Queue: {1}", If(rRealm.Status, "Online", "Offline"), If(rRealm.Queue, "Yes", "No"))
                Console.WriteLine()
            Next

            Console.WriteLine("Press any key to continue.")
            Console.ReadKey(True)
        End Sub

    End Module

End Namespace
